1. Field of the Invention
The present invention relates generally to a method of processing image data of an optical mouse, and more particularly, to a method of processing image data of an optical mouse, which is capable of improving the detection of the two-dimensional motion of an optical mouse.
2. Description of the Prior Art
FIG. 1 is a block diagram showing the processing of image data of a general optical mouse. As shown in FIG. 1, the data process block of the general optical mouse includes an analog process unit 10 that reads the image of a surface under the optical mouse in analog data and converts the analog data into digital data, and a digital process unit 20 that calculates and outputs a motion vector with respect to time using the digital data.
The analog process unit 10 includes an image pixel array 12 that generates an analog image according to the amount and intensity of light reflected by a surface under the optical mouse, and an Analog-to-Digital Converter (ADC) 14 that converts the analog data of the image pixel array 12 into the digital data.
Additionally, the digital process unit 20 includes an Image Signal Processor (ISP) 22 that calculates a motion vector by processing the digital data, and a Personal Computer (PC) interface 24 that receives data output from the image signal processor 22 and transmits data to the image signal processor 22 through data communication.
There is described an algorithm for processing image data of an optical mouse to calculate the motion vector of the optical mouse through the image signal processor 22 with reference to FIG. 2. FIG. 2 is a schematic view illustrating a conventional method of processing image data of an optical mouse.
To implement the algorithm, at least three memory spaces are needed to store pixel data. The memory spaces store the reference image of an n−1 th frame for an X axis and a Y axis, the present image of an nth frame for the X axis and the Y axis, and the reference image of the nth frame for the X axis and the Y axis.
First, the reference image of the n−1 th frame is selectively extracted from the total image of the n−1 th frame in order to find the motion of the optical mouse in the nth frame. The present image of the nth frame is the total image of the nth frame. Last, the reference image of the nth frame is selectively extracted from the present image of the nth frame and become a reference image to find the motion of the optical mouse in an n+1 th frame.
As described above, the moving direction of the motion vector is determined using most approximately equal parts of the reference image of the n−1 th frame and the present image of the nth frame while the reference image of the n−1 th frame is sequentially overlapped with the present image of the nth frame. The reference and present images should ideally coincide with each other by 100%, but the reference and present images does not actually coincide with each other by 100% due to the noise of the images and so on in terms of characteristics of an image sensor.
The motion of the optical mouse is found through repeated performance of the above-described process.
There are matters to be considered in the repeated performance of the process. For one, detection errors of one pixel or less always exist in the algorithm for calculating the motion vector of the optical mouse because the image sensor has a physical size. If the reference image of the n−1 th frame is updated to the reference image of the nth frame in every frame, the motion of the optical mouse cannot be detected when the optical mouse is slowly moved by one pixel or less. To solve this problem, if the reference image of the n−1 th frame is updated only when motion is detected instead of updating the reference image of the n−1 th frame in every frame, the detection errors can be minimized and the motion of the optical mouse can be detected for the case where the optical mouse is slowly moved by one pixel or less.
FIG. 3 is a view illustrating the optimal division of a conventional navigation engine using one channel, which shows a case where a one-channel algorithm is applied. In the case of applying the one-channel algorithm, if the optical mouse moves 0.5 pixel in the X axis direction and 0.2 pixel in the Y axis direction in every frame, for example, at an interval of 588 μs, respectively, the motion of one pixel or less cannot be detected.
In this case, there is described the motion of the optical mouse ranging from a first frame to a sixth frame with reference to FIG. 3, as an example.
Referring to the motion of the optical mouse with respect to time in a present nth frame, if the amounts of motions in the X and Y axis directions are 0 and 0 in the first frame (588 μs*1), respectively, the amounts of the motions in the X and Y axis directions are 0.5 and 0.2 in the second frame (588 μs*2), respectively, the amounts of the motions in the X and Y axis directions are 1 and 0.4 in the third frame (588 μs*3), respectively, the amounts of the motions in the X and Y axis directions are 1.5 and 0.6 in the fourth frame (588 μs*4), respectively, the amounts of the motions in the X and Y axis directions are 2 and 0.8 in the fifth frame (588 μs*5), respectively, and the amounts of the motions in the X and Y axis directions are 2.5 and 1 in the sixth frame (588 μs*6), respectively. As in the above-described method, if the motion of the optical mouse occurs in an eleventh frame, the actual amounts of the motions in the X and Y axis directions are 5 and 2, respectively, but the detected amounts of the motions in the X and Y axis directions are 5 and 0, respectively.
In this case, VX and VY, which are the sum of vectors accumulated in the X axis direction and the sum of vectors accumulated in the Y axis direction, respectively, are represented as the XY coordinates (0, 0) in the second frame in the case where the optical mouse moves 0.5 pixel in the X axis direction and 0.2 pixel in the Y axis direction, compared to the motion of the first frame. The reason is that the motion of one pixel or less cannot be detected when the second frame is compared to the reference image of the n−1 th frame, for example, the first frame. Next, the VX and VY are represented as XY coordinates (1, 0) in the third frame in the case where the optical mouse moves 0.5 pixels in the X axis direction and 0.2 pixel in the Y axis direction, compared to the motion of the second frame. 0.5 pixel is accumulated in the X axis direction in each of the second and third frames from the reference image of the n−1 th frame, and the amount of the motion in the X axis direction therefore becomes 1; while 0.2 pixel is accumulated in the Y axis direction in each of the second and third frames from the reference image of the n−1 th frame, and the amount of motion in the Y axis direction therefore becomes 0.4. Accordingly, motion of one pixel or less cannot be detected, so the value of VY becomes 0. Thereafter, the reference image of the n−1 th frame is updated to the third frame because the value of the VX is changed from 0 to 1.
Accordingly, the motion in only the X axis direction can be detected when the motion of the optical mouse occurs in the eleventh frame, so the values of the VX and the VY are 5 and 0, respectively. However, the motion in the Y axis direction cannot be detected in the case where the optical mouse moves 0.2 pixel in the Y axis direction in every frame, so the value of the VY becomes 0 although the optical mouse actually moves 2 pixels in the Y axis direction.
In short, the XY coordinates of VX and VY, which are the sum of vectors accumulated in the X axis direction and the sum of vectors accumulated in the Y axis direction, respectively, are represented as (2, 0) by the calculation of (0, 0)+(1, 0)+(0, 0)+(1, 0)+(0, 0). Accordingly, although the actual amounts of the motions in the X and Y axis directions are 2.5 and 1 in the sixth frame, respectively, the value of the VY is not detected as “1”. The detection error of the amount of the motion in the X axis is 0.5 by the calculation of 2.5−2 and the detection error of 0.5 is detected in the next frame, that is, a seventh frame. In the case where the motion of the optical mouse occurs in the eleventh frame, the actual amounts of the motions in the X and Y axis directions, are 5 and 2, respectively however, the detected amounts of the motions in the X and Y axis directions, are 5 and 0, respectively. That is, the motion in the X axis direction can be detected, and the motion in the Y axis direction cannot be precisely detected.
In the application of the conventional method of processing image data of the optical mouse, the two-dimensional motion of an optical mouse should be corrected.
That is, if the two-dimensional motion is calculated using a single navigation engine, for example, an algorithm for processing image data, the detection errors of the motion are increased according to conditions under which a reference image is updated. For example, if the condition is set to a case where the motion in the X axis direction or the motion in the Y axis direction is detected, the motion in the Y axis direction is not detected when the motion in the X axis direction is greater than one pixel and the motion in the Y axis direction is equal to or less than one pixel. For another case, if the condition is set to a case where the motion in the X axis direction and the motion in the Y axis direction are detected, the reference image is not updated until the motion in the X axis direction and the motion in the Y axis direction are detected at the same time, so the detection errors of the motion are increased.
Accordingly, if the two-dimensional motion of the optical mouse is calculated using the single navigation engine for processing image data of the conventional optical mouse, the detection of the small motion of one pixel or less of the optical mouse in one direction, for example, the X axis direction or Y axis direction, is actually improved, but the detection of the motion of the optical mouse in the other direction can be deteriorated.